#!/bin/bash

# 设置自定义JAVA_HOME路径
export JAVA_HOME="/Users/admin/.jdks/corretto-11.0.26"

# 检查JAVA_HOME是否设置
if [ -z "$JAVA_HOME" ]; then
    echo "Error: JAVA_HOME not set!"
    echo "Please set JAVA_HOME environment variable."
    exit 1
fi

# 更新PATH
export PATH="$JAVA_HOME/bin:$PATH"

# 启动日志服务器，指定端口
PORT=9526
if [ ! -z "$1" ]; then
    PORT=$1
fi

# 启动日志服务器
start-log-server.sh $PORT 